package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author AXiang
 * @create 2023/10/23 15:59
 **/
@Mapper
public interface SetMealDishMapper {
    //select setmeal_id from setmeal_dish where dish_id in (1,2,3)
    List<Long> getSetMealIdsByDishIds(List<Long> dishIds);

    void insertBatch(List<SetmealDish> setMealDishes);

    void deleteByIds(List<Long> dishIds);

    @Select("select *from setmeal_dish where setmeal_id=#{setmealId}")
    List<SetmealDish> getBySetMealId(Long setmealId);

   @Delete("delete from setmeal_dish where setmeal_id=#{setmealId}")
    void deleteBySetmealId(Long setmealId);
}
